package com.sdk.es.http.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author limaosheng
 * @create 11:59 2021/9/2
 * @desc 事件自定义异常
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SaasException extends RuntimeException {

    private Integer code;
    private String message;

    public SaasException(SaasErrorEnum e) {
        this.code = e.getKey();
        this.message = e.getDesc();
    }

    public SaasException(Integer code,String msg) {
        this.code = code;
        this.message = msg;
    }

    public SaasException(SaasErrorEnum e, String msg) {
        this.code = e.getKey();
        this.message = e.getDesc() +  msg;
    }
}
